// 路由配置
import type { RouteRecordRaw } from 'vue-router'

const isDev = import.meta.env.DEV

const routes: RouteRecordRaw[] = [
  {
    path: '/',
    redirect: '/monitor',
    meta: {
      title: '首页',
      icon: 'House',
    },
  },
  {
    path: '/config',
    name: 'Config',
    component: () => import('../pages/ConfigPage.vue'),
    meta: {
      title: '配置管理',
      icon: 'Setting',
      order: 6,
    },
  },
  {
    path: '/monitor',
    name: 'Monitor',
    component: () => import('../pages/TaskManagementPage.vue'),
    meta: {
      title: '预约历史',
      icon: 'Monitor',
      order: 3,
    },
  },
  {
    path: '/booking-modes',
    name: 'BookingModes',
    component: () => import('../pages/BookingModesPage.vue'),
    meta: {
      title: '预约',
      icon: 'Operation',
      order: 1,
    },
  },
  {

    path: '/appointments',
    name: 'Appointments',
    component: () => import('../pages/AppointmentPage.vue'),
    meta: {
      title: '预约管理',
      icon: 'Document',
      order: 2,
    },
  },
  {
    path: '/monitoring-tasks',
    redirect: '/monitor',
    meta: {
      title: '监控任务',
      icon: 'List',
      deprecated: true,
    },
  },
  {
    path: '/records',
    redirect: '/monitor',
    meta: {
      title: '历史记录',
      icon: 'Clock',
      deprecated: true,
    },
  },
  {
    path: '/:pathMatch(.*)*',
    name: 'NotFound',
    component: () => import('../pages/NotFoundPage.vue'),
    meta: {
      title: '页面未找到',
    },
  },
]

if (isDev) {
  routes.push({
    path: '/placeholder',
    name: 'Placeholder',
    component: () => import('../pages/PlaceholderPage.vue'),
    meta: {
      title: '占号管理',
      icon: 'Star',
      order: 5,
    },
  })
  routes.push({
    path: '/automation',
    name: 'Automation',
    component: () => import('../pages/AutomationPage.vue'),
    meta: {
      title: '自动化预约',
      icon: 'Robot',
      order: 4,
    },
  })
}

export { routes }
